public class Student implements Comparable<Student>{
    //比较两个对象
    int age;
    int shenggao;
    String name ;
    public Student(int age ,int shenggao,String name){
        this.age=age;
        this.shenggao=shenggao;
        this.name=name;
    }

    public static void main(String[] args) {
        Student s1=new Student(18,172,"LI");
        Student s2=new Student(17,180,"ni");
        System.out.println(s1.compareTo(s2));
    }

    @Override
    public int compareTo(Student o) {
        if(this.age<o.age||this.shenggao<o.shenggao){
            return 1;
        }else return 0;
    }
}
